<?php
/*
 * View di Test di Google API Books
 */
$this->breadcrumbs = array(
	Book::label(2),
	Yii::t('app', 'Index'),
);

?>

<h1><?php echo GxHtml::encode(Book::label(2)); ?></h1>

<?php 
   /*
    echo "<pre>";
    print_r($myBooks[0]);
    echo "</pre>";
   */
   
   
    echo "<h3>Results Of Call:</h3>";
    echo "<table>";
    foreach ($myBooks as $item) {
        echo "<tr>";
        
        //Immagine
        if (isset($item['volumeInfo']['imageLinks'])){
           echo "<td><img align=\"left\" src=\"" . $item['volumeInfo']['imageLinks']['smallThumbnail'] . "\"></td> \n";
        } else
           echo "<td>&nbsp;</td>\n";
        
        echo "<td>";
        //Titolo
        echo "<b>".$item->volumeInfo->title ."</b><br />";
        
        //Autore
        echo $item->volumeInfo->authors[0] . " ";
        
        //N. Pagine
        if (isset($item->volumeInfo->pageCount)){
           echo "Pagine:". $item->volumeInfo->pageCount . "<br /> \n";
        }
               
        echo "</td></tr>\n";
    }
    echo "</table>"; 
   
?>